Skip to content

[Auto] Add unit tests for craftd-core#105

Closed
rviannaoliveira wants to merge 6 commits intomainfrom
cover/test-3
Closed

[Auto] Add unit tests for craftd-core#105
rviannaoliveira wants to merge 6 commits intomainfrom
cover/test-3

Conversation

@rviannaoliveira
Copy link
Copy Markdown
Contributor

Auto-generated Unit Tests

Este PR foi gerado automaticamente pelo workflow Auto Generate Cover+Test usando a Claude API.

Evolução de cobertura

Arquivos Cobertura
Antes 16 / 19 84%
Depois 19 / 19 100%

Arquivos cobertos

CraftDContentScaleTest.kt,CraftDComponentKeyTest.kt ImagePropertiesTest.kt

Como funciona

  1. Um PR tocou arquivos em android_kmp/craftd-core
  2. Após o CI passar, o workflow escaneou todos os arquivos sem cobertura
  3. Claude gerou testes JUnit4 + MockK para cada arquivo
  4. Este PR foi criado automaticamente com o resultado

Checklist de revisão

  • Testes compilam sem erros (./gradlew testDebugUnitTest)
  • Testes cobrem os principais caminhos de lógica
  • Edge cases tratados (null, vazio, JSON inválido)

Triggered by PR #103

rviannaoliveira and others added 6 commits April 11, 2026 20:09
- Add IMAGE_COMPONENT to CraftDComponentKey enum
- Add CraftDContentScale enum (CROP, FIT, FILL_BOUNDS, FILL_WIDTH, FILL_HEIGHT, INSIDE, NONE)
- Add ImageProperties data class with url, contentScale, contentDescription, actionProperties

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Compose:
- Add toContentScale() extension mapping CraftDContentScale → ContentScale
- Add CraftDImage composable with injectable imageLoader lambda
- Add CraftDImageBuilder with injectable imageLoader constructor param

XML:
- Add CraftDImageComponent (AppCompatImageView wrapper)
- Add CraftDImageComponentRender with injectable imageLoader
- Register CraftDImageComponentRender in CraftDBuilderManager via optional imageLoader param

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Unit tests for ImageProperties serialization, toContentScale() and CraftDImageBuilder key
- Updated docs/how-to-use/compose.md and view-system.md with CraftDImage usage examples
- Registered CraftDImageBuilder (Coil) in Compose sample and CraftDImageComponentRender (Picasso) in XML sample
- Added CraftDImage entry to dynamic.json
- Switched app-sample-android to local craftd-xml project dependency
- Added Coil 2.6.0 to libs.versions.toml
- Deleted notes.md after context consumed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Warnings Elapsed time
⚠️ KOTLIN detekt yes 150 no 4.6s
⚠️ MARKDOWN markdown-table-formatter 48 1 0 0.32s
⚠️ YAML prettier 18 1 4 0.84s

See detailed report in MegaLinter reports

You could have the same capabilities but better runtime performances if you use a MegaLinter flavor:

MegaLinter is graciously provided by OX Security

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant